import Vue from 'vue';
import VueRouter from 'vue-router';

Vue.use(VueRouter);


// 懒加载载入
const Home = () => import("views/home/Home.vue");
const Product = () => import("views/product/Product.vue");
const Solution = () => import("views/solution/Solution.vue");

const News = () => import("views/news/News.vue");
const NewsListGs = () => import("views/news/newscpns/NewsListGs.vue");
const NewsListHy = () => import("views/news/newscpns/NewsListHy.vue");

const Team = () => import("views/team/Team.vue");
const Profile = () => import("views/profile/Profile.vue");

// 产品中心
const Zhdj = () => import("views/cpzx/zhdj/Zhdj.vue");
const Zzwg = () => import("views/cpzx/zzwg/Zzwg.vue");
const Zhjd = () => import("views/cpzx/zhjd/Zhjd.vue");
const Wyzw = () => import("views/cpzx/wyzw/Wyzw.vue");
const Wydn = () => import("views/cpzx/wydn/Wydn.vue");
const Yqdn = () => import("views/cpzx/yqdn/Yqdn.vue");
const Szxc = () => import("views/cpzx/szxc/Szxc.vue");
const Zyz = () => import("views/cpzx/zyz/Zyz.vue");

// 方案中心
const Gazd = () => import("views/fazx/gazd/Gazd.vue");
const Zjzd = () => import("views/fazx/zjzd/Zjzd.vue");
const Jdzd = () => import("views/fazx/jdzd/Jdzd.vue");
const Qyzd = () => import("views/fazx/qyzd/Qyzd.vue");
const Zhyq = () => import("views/fazx/zhyq/Zhyq.vue");
const SzxcF = () => import("views/fazx/szxc/SzxcF.vue");

// 路由映射
const routes = [
  {
    path: "",
    redirect: "/home"
  },
  {
    path: "/home",
    component: Home
  },
  {
    path: "/product",
    component: Product
  },
  {
    path: "/solution",
    component: Solution
  },
  {
    path: "/news",
    component: News,
    children: [
      {
        path: "",
        redirect: "gsdt"
      },
      {
        path: "gsdt",
        component: NewsListGs
      },
      {
        path: "hydt",
        component: NewsListHy
      }
    ]
  },
  {
    path: "/team",
    component: Team,
  },
  {
    path: "/profile",
    component: Profile
  },
  // 产品中心模块
  {
    path: "/cpzx/zhdj",
    component: Zhdj
  },
  {
    path: "/cpzx/zzwg",
    component: Zzwg
  },
  {
    path: "/cpzx/zhjd",
    component: Zhjd
  },
  {
    path: "/cpzx/wyzw",
    component: Wyzw
  },
  {
    path: "/cpzx/wydn",
    component: Wydn
  },
  {
    path: "/cpzx/yqdn",
    component: Yqdn
  },
  {
    path: "/cpzx/szxc",
    component: Szxc
  },
  {
    path: "/cpzx/zyz",
    component: Zyz
  },
  // 方案中心模块
  {
    path: "/fazx/gazd",
    component: Gazd
  },
  {
    path: "/fazx/zjzd",
    component: Zjzd
  },
  {
    path: "/fazx/jdzd",
    component: Jdzd
  },
  {
    path: "/fazx/qyzd",
    component: Qyzd
  },
  {
    path: "/fazx/zhyq",
    component: Zhyq
  },
  {
    path: "/fazx/szxc",
    component: SzxcF
  }
]

const router = new VueRouter({
  routes,
  // 修改模式
  mode: "hash",
})

export default router
